package com.joesem.sale.client

import android.app.Application
import android.util.Log
import com.blankj.utilcode.util.Utils
import com.igexin.base.api.GTBase
import com.igexin.sdk.GetuiPushException
import com.igexin.sdk.PushManager


class MyApplication : Application() {
    companion object {
        lateinit var instance: MyApplication
    }

    override fun onCreate() {
        super.onCreate()
        instance = this
        Utils.init(instance)
        initGeTuiPush()

    }

    private fun initGeTuiPush() {
        val instance = PushManager.getInstance()
        instance.initialize(applicationContext)
        instance.setDebugLogger(this) { s -> Log.i("PUSH_LOG", s) }
        try {
            instance.checkManifest(this)
        } catch (e: Exception) {
            e.printStackTrace()
        } catch (e: GetuiPushException) {
            e.printStackTrace()
        }

    }
}